package com.cat.adapter.object_adapter;


/**
 * @author cat
 * @version 2025/5/21 10:12
 * @description 适配器类
 * @since JDK17
 */

public class SDAdapterTF implements SDCard {
    // 声明适配者类
    private TFCard tfCard;

    public SDAdapterTF(TFCard tfCard) {
        this.tfCard = tfCard;
    }
    @Override
    public String readSD() {
        System.out.println("使用TF卡的读取功能");
        return tfCard.readTF();
    }

    @Override
    public void writerSD(String msg) {
        System.out.println("使用TF卡的写入功能");
        tfCard.writerTF(msg);
    }
}
